<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>profile</title>
    <link href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <style>
        body {
            background-color: aliceblue;
        }
    </style>
</head>
<body>
<br>
<br><br>
<div class="ui two column centered grid">
    <div class="column">
        <div class="ui secondary  menu">
            <a class="item active" th:href="@{/index}">
                主页
            </a>
            <div class="right menu">
                <a class="ui item active" th:href="@{/to_login}" th:if="${session.user eq null}">
                    登录
                </a>
                <a class="ui item active" th:href="@{/to_register}" th:if="${session.user eq null}">
                    注册
                </a>
                <a class="ui item active" th:href="@{/profile(id=${session.user.id},type=${session.type})}"
                   th:if="${session.user ne null}">
				<span th:if="${session.type eq 0}" th:text="'学生 : '+${session.user.name}">
				</span>
                    <span th:if="${session.type eq 1}" th:text="'教师 : '+${session.user.name}">
				</span>
                    <span th:if="${session.type eq 2}" th:text="'管理员 : '+${session.user.name}">
				</span>
                </a>
                <a class="ui item active" th:href="@{/logout}" th:if="${session.user ne null}">
                    退出
                </a>
            </div>
        </div>
        <br>
        <br>
        <br>
        <div class="ui two column centered grid">
            <div class="ui list">
                <img class="ui medium bordered image"
                     src="https://images.unsplash.com/photo-1616882334141-5e8e2405e471?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80">
            </div>
            <div class="ui list" th:if="${session.type eq 2}">
                <div class="item">
                    <i class="users icon"></i>
                    <div class="content" th:text="${session.user.name}">
                        Semantic UI
                    </div>
                </div>
                <div class="item">
                    <i class="marker icon"></i>
                    <div class="content" th:text="${session.user.sex}">
                        New York, NY
                    </div>
                </div>
                <div class="item">
                    <i class="mail icon"></i>
                    <div class="content">
                        <a href="#">paike@zz.com</a>
                    </div>
                </div>
                <div class="item">
                    <i class="linkify icon"></i>
                    <div class="content">
                        <a href="#">zz.com</a>
                    </div>
                </div>
            </div>
            <div class="ui list" th:if="${session.type eq 1}">
                <div class="item">
                    <i class="users icon"></i>
                    <div class="content" th:text="${session.user.name}">
                        Semantic UI
                    </div>
                </div>
                <div class="item">
                    <i class="marker icon"></i>
                    <div class="content" th:text="${session.user.sex}">
                        New York, NY
                    </div>
                </div>
                <div class="item">
                    <i class="marker icon"></i>
                    <div class="content" th:text="${session.user.age}">
                        New York, NY
                    </div>
                </div>
                <div class="item">
                    <i class="mail icon"></i>
                    <div class="content">
                        <a href="#">paike@zz.com</a>
                    </div>
                </div>
                <div class="item">
                    <i class="linkify icon"></i>
                    <div class="content">
                        <a href="#">zz.com</a>
                    </div>
                </div>
                <br>
                <br>

                <div class="item">
                    <div class="content">
                        <a th:href="@{/to_teacher_password_update(id=${user.id})}">修改密码</a>
                    </div>
                </div>
            </div>
            <div class="ui list" th:if="${session.type eq 0}">
                <div class="item">
                    <i class="users icon"></i>
                    <div class="content" th:text="${user.name}">
                        Semantic UI
                    </div>
                </div>
                <div class="item">
                    <i class="sex icon"></i>
                    <div class="content" th:text="${user.sex}">
                        New York, NY
                    </div>
                </div>
                <div class="item">
                    <i class="age icon"></i>
                    <div class="content" th:text="${user.age}">
                        New York, NY
                    </div>
                </div>
                <div class="item">
                    <i class="state icon"></i>
                    <div class="content" th:text="${user.state}">
                        New York, NY
                    </div>
                </div>
                <div class="item">
                    <i class="mail icon"></i>
                    <div class="content">
                        <a href="#">paike@zz.com</a>
                    </div>
                </div>
                <div class="item">
                    <i class="linkify icon"></i>
                    <div class="content">
                        <a href="#">zz.com</a>
                    </div>
                </div>
                <br>
                <br>
                <div class="item">
                    <div class="content">
                        <a th:href="@{/to_student_password_update(id=${user.id})}">修改密码</a>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
</body>
</html>
